﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Drawing;
using SGP;

namespace AnimationTool
{
    public enum RectType { Image = 0, Collision = 1, Active = 2 };

    public struct RECT
    {
        public int Top, Left, Right, Bottom;

        public int Width
        {
            get { return Right - Left; }
            set { Right = Left + value; }
        }
        public int Height
        {
            get { return Bottom - Top; }
            set { Bottom = Top + value; }
        }
    }

    public struct Frame
    {
        public string FrameName;
        public Point anchorPoint;
        public RECT[] Rect;
        public decimal frameDelay;
        public string eventMessage;
        //public int type;

        public override string ToString()
        {
            return (FrameName == null ? "" : FrameName);
        }
    }

    public struct Animation
    {
        public string AnimationName;
        public string FileName;
        public string path;
        public decimal playSpeed;
        public bool isLooping;
        public List<Frame> frameList;
        public int spriteSheetID;

        public override string ToString()
        {
            return AnimationName;
        }
    }

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form1 form = new Form1();
            form.FormClosed += form.CloseForm1;
            form.Show();
            while (form.run)
            {
                form.Update();
                form.Render();
                Application.DoEvents();
            }

            //Application.Run(new Form1());
        }
    }
}
